<!DOCTYPE html>
<html lang="en" ng-app="report">
<head>
    <meta charset="UTF-8">
    <title></title>
    <title></title>
    <link rel="stylesheet" href="../lib/codemirror/codemirror.css">
    <link rel="stylesheet" href="../lib/bootstrap/bootstrap.css">
    <link rel="stylesheet" href="../lib/addon/show-hint.css">
    <link rel="stylesheet" href="../lib/fileinput/fileinput.min.css">
    <link rel="stylesheet" href="../css/main.css">
    <script src="../lib/jquery/jquery.js"></script>
    <script src="../lib/jquery/jquery.js"></script>
    <script src="../lib/codemirror/codemirror.js"></script>
    <script src="../lib/mode/sql.js"></script>
    <script src="../lib/addon/sql-hint.js"></script>
    <script src="../lib/addon/show-hint.js"></script>
    <script src="../lib/angular/angular.js"></script>
    <script src="../lib/bootstrap/bootstrap.js"></script>
    <script src="../js/controller/report.js"></script>
    <style>


        .tabpanel {
            border-top: none !important;
            border-radius: 0 0 4px 4px !important;
        }
    </style>
</head>
<body ng-controller="reportController">
<div class="container-fluid">
    <h1>Search Undefined</h1>

    <div class="col-xs-12">
        <form class="form-horizontal" role="form">
            <div class="form-group">
                <label for="rpt_name" class="col-xs-3 control-label">Name/Description</label>

                <div class="col-xs-5">
                    <input ng-model="criteria['RPT_NAME']" type="text" class="form-control" id="rpt_name"
                           placeholder="Name">
                </div>

                <div class="col-xs-4">
                    <input ng-model="criteria['RPT_TITLE']" type="text" class="form-control" id="rpt_desc"
                           placeholder="Report Description">
                </div>
            </div>
            <div class="form-group">
                <label for="rpt_cust_code" class="col-xs-3 control-label">Customer Code/Name/Parent</label>

                <div class="col-xs-3">
                    <input ng-model="criteria['CUST_CODE']" type="text" class="form-control" id="rpt_cust_code"
                           placeholder="Customer">
                </div>

                <div class="col-xs-3">
                    <input ng-model="criteria['PARENT_CUST_CODE']" type="text" class="form-control" id="rpt_cust"
                           placeholder="Parent Customer Code">
                </div>
            </div>
            <div class="form-group">
                <label for="rpt_desc" class="col-xs-3 control-label">Report Type</label>

                <div class="col-xs-4">
                    <select ng-model="criteria['TYPE']" class="form-control"
                            ng-options="item.disp for item in rptTypeList"></select>
                </div>

                <div class="col-xs-5">
                    <input ng-model="criteria['KEY']" type="text" class="form-control" id="rpt_key"
                           placeholder="Template Oid/RDF Name">
                </div>
            </div>
            <div class="form-group">
                <label for="rpt_desc" class="col-xs-3 control-label">
                </label>

                <div class="col-xs-9">
                    <button type="submit" class="btn btn-default btn-sm" ng-click="search(false)">Search</button>
                    <button type="submit" class="btn btn-default btn-sm" ng-click="download(false)">Download</button>
                    <button type="submit" class="btn btn-default btn-sm" ng-click="download(true)">Download With Schedule Info</button>
                </div>
            </div>
        </form>
    </div>
    <div class="col-xs-12">
        <table>
            <table class="table table-bordered" cellpadding="0" cellspacing="0">
                <tr>
                    <th>Report Name</th>
                    <th>Customer</th>
                    <th>Report Type</th>
                    <th>SQL</th>
                </tr>
                <tr ng-repeat="item in rptList">
                    <td>{{item['RPT_NAME']}}</td>
                    <td>{{item['CUST_NAME'] + '(' + item['CUST_CODE'] + ')'}}</td>
                    <td>{{item['TYPE']}}</td>
                    <td><a class="btn btn-default btn-xs" ng-if="item['TYPE']!='REPORT'" ng-click="sql(item)">SQL</a>
                    </td>
                </tr>
            </table>
        </table>
    </div>
    <div class="col-xs-8">
        <p>
            <textarea id="sql-editor" class="CodeMirror cm-s-default"></textarea>
        </p>
        <button class="btn btn-default" ng-click="parse()">Parse</button>
    </div>
</div>
<div class="modal hide" id="mask" data-backdrop="static" data-keyboard="false">
    <div class="modal-header">
        <h1>Processing...</h1>
    </div>
    <div class="modal-body">
        <div class="progress progress-striped active">
            <div class="bar" style="width: 100%;"></div>
        </div>
    </div>
</div>
</body>
</html>